//
//  BusinessFramework.h
//  LBBase
//
//  Created by Gary on 15/7/1.
//  Copyright (c) 2015年 Lebo. All rights reserved.
//

#import <Foundation/Foundation.h>

@class BusinessModule;
@protocol BusinessModuleProtocol;
@protocol BusinessListenerProtocol;

/*
 *	业务框架
 */
@interface BusinessFramework : NSObject

/*************************************************
 * Method: sharedInstance
 * Description: 单例入口
 * Author:
 * Date: 15/7/1
 * Parameters In:
 * Parameters Out:
 * Returns:
 * History:
 *************************************************/
+ (instancetype)sharedInstance;

/*************************************************
 * Method: registerBusinessModule
 * Description: 注册业务功能提供模块，注册进来的业务模块的指针所有权也转移给
 *              业务框架
 * Author:
 * Date: 15/7/1
 * Parameters In: 提供具体功能的业务模块接口指针
 * Parameters Out:
 * Returns:
 * History:
 *************************************************/
- (void)registerBusinessModule:(BusinessModule<BusinessModuleProtocol>*)module;

/*************************************************
 * Method: findBusinessListener
 * Description: 查找业务监听对象
 * Author:
 * Date: 15/7/1
 * Parameters In: 需要查找的监听业务通知的对象指针
 * Parameters Out:
 * Returns:
 * History:
 *************************************************/
- (BOOL)findBusinessListener:(id<BusinessListenerProtocol>)listener;

/*************************************************
 * Method: registerBusinessListener
 * Description: 注册业务监听对象
 * Author:
 * Date: 15/7/1
 * Parameters In: 需要监听业务通知的对象指针
 * Parameters Out:
 * Returns:
 * History:
 *************************************************/
- (void)registerBusinessListener:(id<BusinessListenerProtocol>)listener;

/*************************************************
 * Method: unregisterBusinessListener
 * Description: 撤销已注册的业务监听对象
 * Author:
 * Date: 15/7/1
 * Parameters In: 已注册的监听业务通知的对象指针
 * Parameters Out:
 * Returns:
 * History:
 *************************************************/
- (void)unregisterBusinessListener:(id<BusinessListenerProtocol>)listener;

/*************************************************
 * Method: BroadcastBusinessNotification
 * Description: 广播通知
 * Author:
 * Date: 15/7/1
 * Parameters In: notifyID: 业务ID，由模块ID+模块内部功能ID组合而成
 *                inParam: 消息对象的指针，具体跟提供的业务相关
 * Parameters Out:
 * Returns:
 * History:
 *************************************************/
- (void)broadcastBusinessNotification:(unsigned int)notifyID inParam:(id)inParam;

/*************************************************
 * Method: CallBusinessFunc
 * Description: 调用业务功能
 * Author:
 * Date: 15/7/1
 * Parameters In: businessID: 业务ID，由模块ID+模块内部功能ID组合而成
 *                inParam: 业务对象的指针，具体跟提供的业务相关
 * Parameters Out:
 * Returns: 调用是否成功
 * History:
 *************************************************/
- (int)callBusinessFunc:(unsigned int)businessID inParam:(id)inParam;

/*************************************************
 * Method: callBusinessFunc
 * Description: 调用业务功能
 * Author:
 * Date: 15/7/1
 * Parameters In: businessID: 业务ID，由模块ID+模块内部功能ID组合而成
 *                inParam: 业务对象的指针，具体跟提供的业务相关
 * Parameters Out: outParam: 返回的数据体，具体跟提供的业务相关
 * Returns: 调用是否成功
 * History:
 *************************************************/
- (int)callBusinessFunc:(unsigned int)businessID inParam:(id)inParam outParam:(id*)outParam;

@end
